-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): Add maxPodLogsToRender setting (#9131) #14617
feat(server): Add maxPodLogsToRender setting (#9131) #14617
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14617 +/- ##
==========================================
- Coverage 49.44% 49.40% -0.05%
==========================================
Files 273 272 -1
Lines 48662 47994 -668
==========================================
- Hits 24063 23713 -350
+ Misses 22237 21930 -307
+ Partials 2362 2351 -11 ☔ View full report in Codecov by Sentry. |
0ae458d
to
f2db63e
Compare
0eca40b
to
7fbc3e6
Compare
@@ -1569,8 +1569,13 @@ func (s *Server) PodLogs(q *application.ApplicationPodLogsQuery, ws application. | |||
return nil | |||
} | |||
|
|||
if len(pods) > maxPodLogsToRender { | |||
return errors.New("Max pods to view logs are reached. Please provide more granular query.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the root error that ends up in the argocd throwing 500 error responses.
while I agree having a configurable limit may mitigate this to some extent, can we also solve the generic case and treat this error differently?
a 4xx response may be more fitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As specifying the log query will fix the problem I took the codes.InvalidArgument
which will be transformed to http.StatusBadRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the variable should be removed here also?
argo-cd/server/application/application.go
Line 68 in b12630c
maxPodLogsToRender = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Jellyfrog for a good catch! I removed unused const.
7fbc3e6
to
7b334d2
Compare
6d85293
to
09e4113
Compare
09e4113
to
40dca79
Compare
40dca79
to
cc161d1
Compare
cc161d1
to
2b80481
Compare
Is there any progress? This will be my motivation to upgrade the ArgoCD version. |
The implementation is done. I'm waiting for review. |
2b80481
to
76df5f0
Compare
Signed-off-by: lukasz <[email protected]>
76df5f0
to
3a8d1df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
Signed-off-by: lukasz <[email protected]> Co-authored-by: Ishita Sequeira <[email protected]>
Signed-off-by: lukasz <[email protected]> Co-authored-by: Ishita Sequeira <[email protected]>
This PR is adding the configurable
maxPodLogsToRender
. This will allow the Argo-CD administrators to allow higher number of pods logs to be rendered in UI and avoid therpc error: code = Unknown desc = Max pods to view logs are reached. Please provide more granular query.
error as described in the issue #9131.Closes ISSUE #9131
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist:
Please see Contribution FAQs if you have questions about your pull-request.